// pages/noResult/noResult.js

Page({
  data: {
    current: 0,
    recommend: [{
        id: "0",
        image: "../../image/wetGarbage.png",
        textInfo: "食材废料、剩菜剩饭、过期食品、瓜皮果核、花卉绿植、中药药渣等"
      },
      {
        id: "1",
        image: "../../image/dryGarbage.png",
        textInfo: "除可回收物、有害垃圾、厨余垃圾（湿垃圾）以外的其它生活废弃物"
      }
    ],
    recommendList: [{
        id: "1",
        image: "../../image/recyclable.png",
        textInfo: "本身或材质可再利用的纸类、硬纸板、玻璃、塑料、金属、塑料包装，与这些材质有关的如：报纸、杂志、广告单及其它干净的纸类等"
      },
      {
        id: "0",
        image: "../../image/harmfulGarbage.png",
        textInfo: "废电池、废灯管、废药品、废油漆及其容器等对人体健康或者自然环境造成直接或者潜在危害的生活废弃物"
      }
    ]
  },

  // 返回
  back() {
    wx.navigateBack({
      delta: 1
    })
  },

  classification(e) {
    let current = e.currentTarget.dataset.current;
    switch (current) {
      case 0: // 跳转可回收物
        current = 0;
        break;
      case 1: // 跳转有害垃圾
        current = 1;
        break;
      default:
        console.log()
    }
    this.setData({
      current: current
    })
    this.goClassiFication();
  },

  goIntoClass(e) {
    let current = e.currentTarget.dataset.value;
    switch (current) {
      case 0: // 跳转湿垃圾
        current = 2;
        break;
      case 1: // 跳转干垃圾
        current = 3;
        break;
      default:
        console.log()
    }
    this.setData({
      current: current
    })
    this.goClassiFication();
  },

  // 跳转
  goClassiFication() {
    getApp().globalData.current = this.data.current;
    wx.switchTab({
      url: '/pages/classification/classification',
    })
  },

  onLoad: function() {

  },

  onShareAppMessage: function() {
    wx.showShareMenu({
      withShareTicket: true
    })
  },

})